#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME)))

require "#{LKP_SRC}/lib/string_ext"

stats_name = 'fail: 1'

while (line = $stdin.gets)
  line = line.resolve_invalid_bytes

  case line
  when /^rsync error/
    break
  when /^total size is \S+  speedup is \S+$/
    stats_name = 'pass: 1'
    break
  end
end

puts stats_name
